package jiChu;

import com.google.common.base.Strings;
import org.apache.commons.lang.StringUtils;
import org.junit.Test;

/**
 * Created by csmd on 2017/12/17.
 */
public class test {
    public static void main(String[] args) {
        //判断字符串为空
        String s = "ss";
        System.out.println(Strings.isNullOrEmpty(s));;
    }
    @Test
    //isEmpty  "ww"   isEmpty   false
    // "" isEmpty   true
    //null   isEmpty    java.lang.NullPointerException
    public void t( ) {
        //判断字符串为空
        String s = null;
        System.out.println(s.isEmpty());;
    }
    @Test
//StringUtils.isEmpty   判断为""  null
    public void t2( ) {
        //判断字符串为空
        String s = null;
        //String s = "           ";
        System.out.println(StringUtils.isEmpty(s));
        System.out.println(StringUtils.isBlank(s));//默认会去掉空格处理

    }
}
